package com.maxd.respository.activitties;

import com.maxd.model.ActivityJoinRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface ActivityJoinRecordRepository extends JpaRepository<ActivityJoinRecord, Long>, JpaSpecificationExecutor<ActivityJoinRecord> {

    @Transactional
    @Modifying
    @Query("update ActivityJoinRecord r set r.status = :status where r.transId = :transId")
    Integer updateStatus(@Param("transId") String transId, @Param("status") String status);
}